package edu.zut.oop_test.test2;

/**
 * 学生实体类
 */
public class Student {

    String number;
    String name;
    int age;
    //.......
    //学生与班级  一个学生只能在一个班级
    Grade grade;

    //学生和课程   一对多  一个学生选多门课
    Course[] courses;


    public void set(String a,String b,int c){
        number = a;
        name = b;
        age = c;
    }
    public void tell() {
        System.out.println("学生" + name + ",今年" + age);
    }

    public void say() {
        System.out.println("学生" + name + ",今年" + age + "岁，在" + grade.name + "班");
    }


    public static void main(String[] args) {

        Student student = new Student();
        student.number = "2021001";
        student.name = "jack";
        student.age = 20;
        Grade grade = new Grade();
        grade.number = "bg218";
        grade.name = "大数据218";
        grade.msg = "这是大数据专业21级8班";
        student.grade = grade;
        student.say();
    }


}
